package cn.convert.action;

public class AdminAction extends BaseAction {
	private String adminname;
	private String adminpass;
	private String zipcode;
	public String getAdminname() {
		return adminname;
	}
	public void setAdminname(String adminname) {
		this.adminname = adminname;
	}
	public String getAdminpass() {
		return adminpass;
	}
	public void setAdminpass(String adminpass) {
		this.adminpass = adminpass;
	}
	
	public String getZipcode() {
		return zipcode;
	}
	public void setZipcode(String zipcode) {
		this.zipcode = zipcode;
	}
	public String adminLogin(){
		if (adminname!=null&&adminname.trim().length()==0) {
			addFieldError("adminname", getText("error.adminname.required"));
		}
		if (adminpass!=null&&adminpass.trim().length()==0) {
			addFieldError("adminpass", getText("error.adminpass.required"));
		}
		if (adminname.equals("admin")&&adminpass.equals("admin")) {
			return SUCCESS;
		}
		return INPUT;
	}
	/*public void validateAdminLogin(){
		if (adminname!=null&&adminname.trim().length()==0) {
			addFieldError("adminname", getText("error.adminname.required"));
		}
		if (adminpass!=null&&adminpass.trim().length()==0) {
			addFieldError("adminpass", getText("error.adminpass.required"));
		}
	}*/

}
